package com.yonyou.lxp.xutils3test.views.dialog;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.yonyou.lxp.xutils3test.R;
import com.yonyou.lxp.xutils3test.ui.BaseFragment;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

import java.util.ArrayList;
import java.util.List;


@ContentView(R.layout.datatest)
public class DataFragment extends BaseFragment {

    @ViewInject(R.id.lv_year)
    private ListView lv_year;
    @ViewInject(R.id.lv_month)
    private ListView lv_month;
    @ViewInject(R.id.lv_day)
    private ListView lv_day;

    private ArrayAdapter<Integer> adapter_year;
    private ArrayAdapter<Integer> adapter_month;
    private ArrayAdapter<Integer> adapter_day;

    private List<Integer> list_year=new ArrayList<>();
    private List<Integer> list_month=new ArrayList<>();
    private List<Integer> list_day=new ArrayList<>();

    public static DataFragment newInstance(String param1, String param2) {
        DataFragment fragment = new DataFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView();
    }

    private void initView(){
        adapter_year=new ArrayAdapter<Integer>(mContext,android.R.layout.simple_list_item_1,list_year);
        adapter_month=new ArrayAdapter<Integer>(mContext,android.R.layout.simple_list_item_1,list_month);
        adapter_day=new ArrayAdapter<Integer>(mContext,android.R.layout.simple_list_item_1,list_day);

        lv_year.setAdapter(adapter_year);
        lv_month.setAdapter(adapter_month);
        lv_day.setAdapter(adapter_day);
    }

    private void getData(){

    }
}
